package com.mt.api.core.config.filter;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: plover
 * @Date: 2020/08/08/10:33 上午
 * @Description:
 */
@Configuration
public class FilterConfig {

    //如果涉及到需要重复利用reques body，可以打开
    // @Bean
    public FilterRegistrationBean<BodyReaderFilter> Filters() {
        FilterRegistrationBean<BodyReaderFilter> registrationBean = new FilterRegistrationBean();
        registrationBean.setFilter(new BodyReaderFilter());
        registrationBean.addUrlPatterns("/*");
        registrationBean.setName("body-analysis-channel-filter");
        return registrationBean;
    }
}
